#include <cstdio>
#include <cstdlib>
#include <cmath>

int calculateCycle(int n)
{
	int count = 1;
	int num = n;
	
	while(num != 1)
	{
		if ((num % 2) == 0)
		{
			num = num/2;
		}
		else
		{
			num = 3 * num + 1;
		}
		
		count++;
	}

	return count;
}

int main()
{
	int i , j;
	
	while(scanf("%d %d" , &i , &j) != EOF)
	{
		int maxSum = 0;
		int bot , top;
	
		if (i > j) 
		{
			bot = j;
			top = i;
		}
		else
		{
			bot = i;
			top = j;
		}

		for (int k = bot ; k <= top; ++k)
		{
			int sum = calculateCycle(k);
			
			if (sum > maxSum)
			{
				maxSum = sum;
			}	
		}
		
		printf("%d %d %d\n" , i , j , maxSum);
	}

	return 0;
}